package com.ruoyi.business.youdaoController;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.business.services.HttpService;
import com.ruoyi.common.utils.http.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("ownHLWApi")
public class DzwadController {

    String url = "http://api.dzwad.com/ad/get/request.do";

    @Autowired
    private HttpService httpService;


    @RequestMapping("/send")
    public Object send(@RequestBody JSONObject params) throws Exception {


        String body = HttpUtil.createPost(url)
                .body(JSON.toJSONString(params))
                .execute()
                .body();

        return body;
    }
}
